import subprocess
import time

start = time.time()
sleep_procs = []
for _ in range(10):
    proc = subprocess.Popen(['sleep', '1'])
    sleep_procs.append(proc)

for proc in sleep_procs:
    stdout_data, stderr_data = proc.communicate()
    print('stdout_data', stdout_data, 'stderr_data', stderr_data)
end = time.time()
delta = end - start
print(f'Finished in {delta:.3} seconds')
